package com.huixh.train.gateway.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;

/**
 * @author huixh
 */
@EnableDiscoveryClient
@SpringBootApplication
@ComponentScan("com.huixh.train")
public class GatewayApplication {
    private static final Logger LOG = LoggerFactory.getLogger(GatewayApplication.class);

    public static void main(String[] args) {
        ConfigurableApplicationContext app = SpringApplication.run(GatewayApplication.class, args);
        Environment env = app.getEnvironment();
        LOG.info("启动成功！！");
        LOG.info("项目基础地址: http://127.0.0.1:{}", env.getProperty("server.port"));
    }
}
